package chain_to_chain

import (
	"chain_bridge_service/internal/pkg/core"
	"chain_bridge_service/internal/repository/mongodb"
	"chain_bridge_service/internal/repository/mongodb/chain_config"
	"chain_bridge_service/internal/repository/mongodb/chain_to_chain"
	"chain_bridge_service/internal/repository/mongodb/chain_token"
)

var _ Service = (*service)(nil)

type Service interface {
	i()
	List(ctx core.Context, pageIndex uint, pageSize uint, createData *CreateChainData) (chainDataList []chian_to_chain.ChainToChain, err error)
	Create(ctx core.Context, createData *CreateChainData) (err error)
	Update(ctx core.Context, createData *CreateChainData) (err error)
	Delete(ctx core.Context, createData *CreateChainData) (err error)
	Count(ctx core.Context, createData *CreateChainData) (count int64, err error)
	Find(ctx core.Context, createData *CreateChainData) (lists []chain_config.ChainConfig, err error)
	FindToken(ctx core.Context, createData *CreateChainData) (lists []chain_token.ChainToken, err error)
	ApiList(ctx core.Context, userId string) ([]ChainData, error)
	GetRate(ctx core.Context, data *CreateChainData) (chian_to_chain.ChainToChain, error)
}

type service struct {
	db mongodb.Repo
}

func New(db mongodb.Repo) Service {
	return &service{
		db: db,
	}
}

func (s *service) i() {}
